Main Page Modules Compound List File List Compound Members File Members Related Pages

# odbc_util.h

    00001 /* FreeTDS - Library of routines accessing Sybase and Microsoft databases
    00002  * Copyright (C) 1998-1999  Brian Bruns
    00003  *
    00004  * This library is free software; you can redistribute it and/or
    00005  * modify it under the terms of the GNU Library General Public
    00006  * License as published by the Free Software Foundation; either
    00007  * version 2 of the License, or (at your option) any later version.
    00008  *
    00009  * This library is distributed in the hope that it will be useful,
    00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
    00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    00012  * Library General Public License for more details.
    00013  *
    00014  * You should have received a copy of the GNU Library General Public
    00015  * License along with this library; if not, write to the
    00016  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    00017  * Boston, MA 02111-1307, USA.
    00018  */
    00019
    00020 #ifndef ODBC_UTIL_h
    00021 #define ODBC_UTIL_h
    00022
    00023 #if HAVE_CONFIG_H
    00024 #include <config.h>
    00025 #endif /* HAVE_CONFIG_H */
    00026
    00027 #if defined(UNIXODBC) || defined(TDS_NO_DM)
    00028 #include <sql.h>
    00029 #include <sqlext.h>
    00030 #else /* iODBC */
    00031 #include "isql.h"
    00032 #include "isqlext.h"
    00033 #endif
    00034
    00035 static char rcsid_odbc_util_h[] = "$Id: odbc_util.h,v 1.23 2004/01/08 10:27:46 freddy77 Exp $";
    00036 static void *no_unused_odbc_util_h_warn[] = { rcsid_odbc_util_h, no_unused_odbc_util_h_warn };
    00037
    00038 int odbc_set_stmt_query(struct _hstmt *stmt, const char *sql, int sql_len);
    00039 int odbc_set_stmt_prepared_query(struct _hstmt *stmt, const char *sql, int sql_len);
    00040 void odbc_set_return_status(struct _hstmt *stmt);
    00041 void odbc_set_return_params(struct _hstmt *stmt);
    00042
    00043 SQLSMALLINT odbc_server_to_sql_type(int col_type, int col_size);
    00044 int odbc_sql_to_c_type_default(int sql_type);
    00045 int odbc_sql_to_server_type(TDSSOCKET * tds, int sql_type);
    00046 int odbc_c_to_server_type(int c_type);
    00047
    00048 char *odbc_server_to_sql_typename(TDSCOLINFO * col, int odbc_ver);
    00049 SQLINTEGER odbc_sql_to_displaysize(int sqltype, int column_size, int column_prec);
    00050 int odbc_get_string_size(int size, SQLCHAR * str);
    00051 void odbc_rdbms_version(TDSSOCKET * tds_socket, char *pversion_string);
    00052 SQLINTEGER odbc_get_param_len(TDSSOCKET * tds, struct _drecord *drec_apd, struct _drecord *drec_ipd);
    00053
    00054 SQLRETURN odbc_set_string(SQLPOINTER buffer, SQLSMALLINT cbBuffer, SQLSMALLINT FAR * pcbBuffer, const char *s, int len);
    00055 SQLRETURN odbc_set_string_i(SQLPOINTER buffer, SQLINTEGER cbBuffer, SQLINTEGER FAR * pcbBuffer, const char *s, int len);
    00056
    00057 SQLSMALLINT odbc_get_concise_sql_type(SQLSMALLINT type, SQLSMALLINT interval);
    00058 SQLRETURN odbc_set_concise_sql_type(SQLSMALLINT concise_type, struct _drecord *drec, int check_only);
    00059 SQLSMALLINT odbc_get_concise_c_type(SQLSMALLINT type, SQLSMALLINT interval);
    00060 SQLRETURN odbc_set_concise_c_type(SQLSMALLINT concise_type, struct _drecord *drec, int check_only);
    00061
    00062 #endif